<div id="content">
	<div id="top">
		<h3>Checklists</h3>
		<%= render :partial => '/partials/help_link', :locals => {:path => {:controller => "help", :action => "checklists", :anchor => "index"}} %>
		<div id="filter">
			<div class="left">
				<p><%= page_entries_info @page_results, {:entry_name => "Checklist"} %></p>
			</div>
			<div class="right">
				<%= link_to (@show_hidden ? 'Hide Hidden' : 'Show Hidden'), toggle_hidden_checklists_path %>
				<%= link_to "New Checklist", new_checklist_path %>
			</div>
		</div>
	</div>

	<table id="list" class="checklists">
		<tr>
			<th class="first">Name</th>
			<th class="second">Type</th>
			<th class="third">Couriers</th>
			<th class="last"></th>
		</tr>

		<% @page_results.each do |checklist| %>
			<tr class="row<%= ' fade' if checklist.hidden %>">
				<td class="first">
					<%= checklist.name %>
				</td>
				<td class="second">
					<%= checklist.checklist_type.capitalize %>
				</td>
				<td class="third">
					<%= checklist.checklist_recurrence_rules.map {|x| x.courier.real_name}.inject {|a,e| "#{a}, #{e}"} %>
				</td>
				<td class="last">
					<%= link_to (checklist.hidden ? 'Un-Hide' : 'Hide'), checklist, :method => :delete %>
					<%= link_to 'Edit', edit_checklist_path(checklist) %>
				</td>
			</tr>
		<% end %>
	</table>
	
	<div id="pagination">
		<%= will_paginate @page_results %>
	</div>
</div>